<?php

// No direct access
 
defined('_JEXEC') or die('Restricted access'); ?>
<h1>Kudeaketa/Administration</h1>
<br/>
<br/>
<form action="" id="admintabs" method="post">
	<input type="hidden" name="option" id="option" value="com_hizkimizki"/>
	<input type="hidden" name="task" id="task" value="createTranslation"/>
	<input type="hidden" name="pcode" id="pcode" value="" />
	<input type="hidden" name="code" id="code" value=""/>
	<input type="hidden" name="admin" id="admin" value="true"/>
	<h2>Proposamenak/Proposals (<?php echo(count($this->proposals));?>)</h2>
	<br/>
	<a href="index.php?option=com_hizkimizki&task=createTranslation" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button">
		<span class="ui-button-text">Proposamen Berria/Add Proposal</span>
	</a>
	<br/>
	<br/>
	<br/>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="proposalAdminTables">
		<thead>
			<tr>
				<th>Hizkuntza/Language</th>
				<th>ISO-Code</th>
				<th>Egoera/Status</th>
				<th>Egilea/Author</th>
				<th>Email</th>
				<th>Data/Date</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<?php 
				$i = 0;
				foreach($this->proposals as $l){
					if ($i==0){
						print('<tr class="odd">');
						$i=1;
					}
					else if($i==1){
						print('<tr class="even">');
						$i=0;
					}
					print("<td>".$l->getName()."</td>");
					print("<td>".$l->getId()."</td>");
					print("<td>".$l->getActive()."</td>");
					print("<td>".$l->getAuthor()."</td>");
					print("<td>".$l->getEmail()."</td>");
					print("<td>".$l->getDate()."</td>");
					print('<td><a href="index.php?option=com_hizkimizki&task=editTranslation&pcode='.$l->getId().'" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"> <span class="ui-button-text">Kudeatu/Edit</span></a></td>');
					print("</tr>");
				}
			?>
		</tbody>
		<tfoot>
			<tr>
				<th>Hizkuntza/Language</th>
				<th>ISO-Code</th>
				<th>Egoera/Status</th>
				<th>Egilea/Author</th>
				<th>Email</th>
				<th>Data/Date</th>
				<th></th>
			</tr>
		</tfoot>
	</table>
	<br/>
	<br/>
	<br/>
	<br/>
	<h2>Hizkuntz Onartuak/Accepted Translations (<?php echo(count($this->langs));?>)</h2>
	<br/>
	<br/>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="display" id="languageAdminTable">
		<thead>
			<tr>
				<th>ISO-Code</th>
				<th>Aktibo/Active</th>
				<th>Egilea/Author</th>
				<th>Email</th>
				<th>Data/Date</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<?php 
				$i = 0;
				
				foreach($this->langs as $l){
					if ($i==0){
						print('<tr class="odd">');
						$i=1;
					}
					else if($i==1){
						print('<tr class="even">');
						$i=0;
					}
					print("<td>".$l->getId()."</td>");
					print("<td>".(($l->getActive() == 1)?"Bai/Yes":"Ez/No")."</td>");
					print("<td>".$l->getAuthor()."</td>");
					print("<td>".$l->getEmail()."</td>");
					print("<td>".$l->getDate()."</td>");
					print('<td><a href="index.php?option=com_hizkimizki&task=editTranslation&code='.$l->getId().'" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button"> <span class="ui-button-text">Kudeatu/Edit</span></a></td>');
					print("</tr>");
				}
			?>
		</tbody>
		<tfoot>
			<tr>
				<th>ISO-Code</th>
				<th>Egoera/Status</th>
				<th>Egilea/Author</th>
				<th>Email</th>
				<th>Data/Date</th>
				<th></th>
			</tr>
		</tfoot>
	</table>
	</div>
</div>
